<html>
<head>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link href="${ctx}/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="${ctx}/font-awesome/3.0.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="${ctx}/bootstrap-table/1.12.0/bootstrap-table.min.css" rel="stylesheet">
    <link href="${ctx}/css/index.css" rel="stylesheet">
    <script src="${ctx}/jquery/2.1.4/jquery.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="${ctx}/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="${ctx}/bootstrap-table/1.12.0/bootstrap-table.min.js"></script>

    <style>
        * {
            font-size: 12px;
        }

        [class^="col-"] {
            vertical-align: middle;
            line-height: 34px;
            min-height: 34px;
            margin-bottom: 12px;
        }

        .form-control {
            margin: 0;
        }

        .form-control-static {
            min-height: 34px;
            padding: 0;
            margin-bottom: 0;
        }

        .align-right {
            text-align: right;
        }

        input {
            padding-left: 15px;
        }
    </style>
</head>

<body style="height: 380px; overflow-y: hidden;">
<div class="row">
    <div class="col-xs-2 col-xs-offset-2 align-right">编码：</div>
    <div class="col-xs-6">
        <input class="form-control" id="code" value="<#if store??>${store.code}</#if>">
    </div>
</div>
<div class="row">
    <div class="col-xs-2 col-xs-offset-2 align-right">名称：</div>
    <div class="col-xs-6">
        <input class="form-control" id="name" value="<#if store??>${store.name}</#if>">
    </div>
</div>
<div class="row">
    <div class="col-xs-2 col-xs-offset-2 align-right">地址：</div>
    <div class="col-xs-6">
        <input class="form-control" id="address" value="<#if store??>${store.address}</#if>">
    </div>
</div>
<div class="row">
    <div class="col-xs-2 col-xs-offset-2 align-right">包名：</div>
    <div class="col-xs-6">
        <input class="form-control" id="packagename" value="<#if store??>${store.packagename}</#if>">
    </div>
</div>
<div class="row">
    <div class="col-xs-2 col-xs-offset-2 align-right">设备品牌：</div>
    <div class="col-xs-6">
        <input class="form-control" id="brand" value="<#if store??>${store.brand}</#if>">
    </div>
</div>

<div class="row">
    <div class="col-xs-6 col-xs-offset-4" style="text-align: left">
        <button id="save_btn" style="position:relative; " type="button" class="btn btn-primary">保存</button>
    </div>
</div>
<script>
    $(function () {
        $("#save_btn").click(function () {
            if (confirm("确定保存？")) {
                $.post("/app/saveOrUpdateStore", {
                    code: $("#code").val(),
                    name: $("#name").val(),
                    address: $("#address").val(),
                    packagename: $("#packagename").val(),
                    brand: $("#brand").val()
                }, function (res) {
                    alert(res);
                    window.parent.iw.closeDialog();
                });
            }
        });
    });
</script>
</body>
</html>